/**
 * 
 */
package meituan;

import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 最大矩形面积 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner=new Scanner(System.in);
		int n=scanner.nextInt();
		int[] h=new int[n];
		for (int i = 0; i < n; i++) {
			h[i]=scanner.nextInt();
		}
		
		
	}

}
